<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<html>
<head>
<title>FINIAC | Finance Manager</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
function formReset()
{
document.getElementById("frm1").reset();
}
</script>

<script language="JavaScript" src="../html/calendar_us.js"></script>
<script src="../script/jquery-1.7.1.min.js" type="text/javascript"></script>
	<link rel="stylesheet" href="../html/calendar.css">
<link href="../css/styles.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
$(document).ready(function() {
	var passwordLength = getUrlVars()["passwordLength"];
	var nullValue = getUrlVars()["nullValue"];
	if(nullValue)
	{
	$('#messageSpan').text("Please Fill All Fields");
	 $("#message").fadeIn("slow");
	    $("#message a.close-notify").click(function() {
	        $("#message").fadeOut("slow");
	        return false;
	    });	
	}
	
	if(passwordLength)
		{
		$('#messageSpan').text("Length of password and username must be greater than 6");
		 $("#message").fadeIn("slow");
		    $("#message a.close-notify").click(function() {
		        $("#message").fadeOut("slow");
		        return false;
		    });	
		}
	
});
function getUrlVars() {
    var vars = {};
    var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
        vars[key] = value;
    });
    return vars;
}
</script>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 5px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style>
<script type="text/javascript">
$(document).ready( function(){
	$("select option[value='${user.role}']").attr("selected","selected");
});

</script>
</head>

<body onload="initForm();">
<div id='message' style="display: none;">
    <span id='messageSpan'>Hey, This is my Message.</span>
    <a href="#" class="close-notify">X</a>
</div>
<form:form action="updateUser.htm"  name="addStock" >
<table width="100%" border="0">

		<tr>
			<td><span class="Bredcrumbs">Stock&gt;&gt; Add Stock&gt;&gt;</span></td>
		</tr>
		<tr>
			<td>
			<table width="100%" border="0" cellpadding="0" cellspacing="0">
				<tr>
					<td width="9"><img src="../images/Tright_03_01.gif" width="9"
						height="29"></td>
					<td background="../images/Tcenter.gif" class="body"><strong
						class="boxheader"> Payment Entry </strong></td>

					<td width="10"><img src="../images/Tright_1_01.gif" width="9"
						height="29"></td>
				</tr>
				<tr>
					<td height="452" valign="top" background="../images/Tright_03_03.gif"></td>
				  <td valign="top" class="news">
					<table width="100%" cellspacing="1" cellpadding="2">
						<tr bgcolor="#FFFFFF">
							<td height="20" colspan="4">
							<div align="right">
							  <div id="div"><FONT color="red"></FONT> <FONT color="green"> </FONT>                                         
						      </div>
							</div>
							<div id="errorMessage"><FONT color="red"></FONT>
							<FONT color="green">  </FONT></div>
							</td>
						</tr>

						<tr>
							<td valign="top" class="news">
							<table width="100%" border="0" align="center" cellpadding="0"
								cellspacing="0">
								<tr>
									<td><img src="../images/01.gif" width="5" height="5" /></td>
									<td width="914" background="../images/02.gif"></td>
									<td><img src="../images/03.gif" width="5" height="5" /></td>
								</tr>
								<tr>
									<td width="5" background="../images/left.gif"></td>
									<td valign="top">
									<table width="100%" cellspacing="1" cellpadding="2">
					
						<tr>
						<input type="text" hidden="true" value="${user.id }" name=userId id="userId"/>
							<td height="25" class="row-odd">
							<div align="right"><span class="Mandatory">*</span>Username :</div></td>
							<td height="25" class="row-even"><input name="userName" type="text" id="userName" readonly="readonly" value="${user.userName }" class="row-white" autocomplete="off"/></td>
							<td height="25" class="row-odd">
							<div align="right">New Password :</div></td>
							<td height="25" class="row-even"><input type="password" name="password" id="password"  class="row-white" autocomplete="off"/>
							<span><FONT color="red" size="1">(Leave blank if no change in password)</FONT></span>
							</td>
					
						</tr>
						<tr>
						<td class="row-odd">
							<div align="right"><span class="Mandatory">*</span> Role:</div>
							</td>
							<td class="row-even"><span class="star"><select name="role" id="role">
								<option value="" label="">SELECT</option>
								<option value="ADMIN" label="ADMIN">ADMIN</option>
								<option value="USER" label="USER">USER</option>
							</select></span></td>
							<td class="row-even"> </td>
							<td class="row-even"> </td>
						</tr>
						
						<tr>

							</table>
							    </td>
									<td width="5" height="29" background="../images/right.gif"></td>
								</tr>
			
								<tr>
									<td height="5"><img src="../images/04.gif" width="5" height="5" /></td>
									<td background="../images/05.gif"></td>
									<td><img src="../images/06.gif" /></td>
								</tr>
							</table>
							</td>
							<td valign="top" background="../images/Tright_3_3.gif" class="news"></td>
						</tr>


						<tr>
							<td height="25" colspan="4">
							<table width="100%" border="0" cellspacing="0" cellpadding="0">
								<tr>
									<td width="45%" height="35">
									<div align="right">
										
										
											<input type="submit" name="submit" value="Submit"  class="formbutton">
										
									</div>
									</td>
									<td width="2%"></td>
									<td width="53%">
										
										
											<input type="reset" name="reset" value="Reset" onClick="formReset()" class="formbutton">
										
									</td>
								</tr>
								
							</table>
							
							</td>
						</tr>

					

					</table>
					</td>
					<td width="10" valign="top" background="../images/Tright_3_3.gif"
						class="news"></td>
				</tr>

				<tr>
					<td valign="top" background="../images/Tright_03_03.gif"></td>
					<td height="20" valign="top"></td>
					<td width="13" valign="top" background="../images/Tright_3_3.gif"
						class="news"></td>
				</tr>
				<tr>
					<td><img src="../images/Tright_03_05.gif" width="9" height="29" /></td>
					<td width="100%" background="../images/TcenterD.gif"></td>
					<td><img src="../images/Tright_02.gif" width="9" height="29" /></td>
				</tr>
			</table>
			</td>
		</tr>

	</table>
</form:form>
</body>
</html>